﻿using DbMapper.model;
using DbMapper.service;
using DbMapper.viewmodel;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DbMapper.controller
{
    class DataGroupController
    {
        DbMapperService DbMapperService = new DbMapperService();
        public DataGroupViewModel dataGroupViewModel { get; set; } = new DataGroupViewModel();

        public void UpdateDatabase(DbInfo dbInfo)
        {
            dataGroupViewModel.DbInfo = dbInfo;
            DbMapperService.UpdateDatabase(dbInfo);
        }

        public SqlDataReader GetTableName()
        {
            return DbMapperService.GetTableName();
        }

        public SqlDataReader GetTableField(string name)
        {
            return DbMapperService.GetTableField(name);
        }
    }
}
